package com.zhifei.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhifei.system.domain.EmployeeEntity;
import com.zhifei.system.domain.XrxsEmployeeEntity;
import com.zhifei.system.domain.vo.EmployeeGanttChartItemVo;
import com.zhifei.system.domain.vo.EmployeeGanttChartVo;
import com.zhifei.system.domain.vo.EmployeeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface EmployeeMapper extends BaseMapper<EmployeeEntity> {

    List<EmployeeVo> queryPage(Page page,@Param("customerName")String customerName,@Param("employeeStatus")Integer employeeStatus,@Param("userPost")String userPost,@Param("userRank")String userRank,@Param("admissionStartDate")String admissionStartDate,@Param("admissionEndDate")String admissionEndDate,
                               @Param("leaveProjectStartDate")String leaveProjectStartDate,@Param("leaveProjectEndDate")String leaveProjectEndDate,@Param("serviceManager")String serviceManager,@Param("recruitHr")String recruitHr,@Param("leaveProjectStatus")Integer leaveProjectStatus,@Param("name")String name,
                               @Param("orderNo")String orderNo,@Param("sortField")String sortField,@Param("sortType")String sortType);

    List<EmployeeGanttChartVo> pageEmployeeGroupByJobNum(Page page, @Param("customerName")String customerName, @Param("employeeStatus")Integer employeeStatus, @Param("userPost")String userPost, @Param("userRank")String userRank, @Param("admissionStartDate")String admissionStartDate, @Param("admissionEndDate")String admissionEndDate,
                                         @Param("leaveProjectStartDate")String leaveProjectStartDate, @Param("leaveProjectEndDate")String leaveProjectEndDate, @Param("serviceManager")String serviceManager, @Param("recruitHr")String recruitHr,@Param("leaveProjectStatus")Integer leaveProjectStatus,@Param("name")String name,@Param("orderNo")String orderNo);

    List<EmployeeGanttChartItemVo> listEmployeeGanttChartItem(@Param("jobNumList")List<String> jobNumList);

    List<EmployeeEntity> listDistinctEmployee();

    void dismissEmployee(@Param("jobNum")String jobNum,@Param("dismissDate")String dismissDate);

    void updateEmployee(@Param("jobNum")String jobNum, @Param("userPost")String userPost, @Param("userRank")String userRank, @Param("monthPay") BigDecimal monthPay, @Param("recruitHr")String recruitHr);

    EmployeeEntity getPreProjectEmployee(@Param("jobNum")String jobNum);

    EmployeeEntity getEmployee(@Param("jobNum")String jobNum);

    void updatePost(@Param("employeeId")Long employeeId,@Param("updatePostDate")String updatePostDate);

}
